package com.love.marriage.common.exceptions;

import com.love.marriage.common.enums.ResultEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;

/**
 * description:  文件异常
 * author:       majf
 * createDate:   2022/7/12 16:21
 * version:      1.0.0
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Slf4j
public class SystemException extends RuntimeException {

    private String code;

    private String msg;

    public SystemException(ResultEnum resultEnum) {
        log.error(resultEnum.getCode() + ":" + resultEnum.getValue());
        this.code = resultEnum.getCode();
        this.msg = resultEnum.getValue();
    }

    public SystemException(String code, String msg) {
        log.error(code + ":" + msg);
        this.code = code;
        this.msg = msg;
    }
}
